/*
 * Copyright (c) 2020.
 * http://www.ulabcare.com
 */

package com.mt.roll.upms.params;

import com.mt.roll.core.base.BaseParam;
import com.mt.roll.core.validator.groups.AddGroup;
import com.mt.roll.core.validator.groups.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/** 
* @Description: 新增或者修改岗位入参
* @Param:  
* @return:  
* @Author: tqq
* @Date: 2019/11/11 15:53 
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "新增或者修改岗位入参", description = "用于新增和更新岗位信息")
public class SysPostParam extends BaseParam {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键，更新时需要填写", example = "1")
    @NotNull(message = "岗位ID不能为空", groups = {UpdateGroup.class})
    private Long id;

    @ApiModelProperty(value = "父岗位ID(第一个岗位的上级岗位ID填0)", required = true, example = "0")
    @NotNull(message = "父岗位ID不能为空", groups = {AddGroup.class})
    @Min(message = "父岗位ID不能小于0", value = 0, groups = {AddGroup.class})
    private Long parentId;

    @ApiModelProperty(value = "岗位编码", required = true, example = "manager")
    @NotBlank(message = "岗位编码不能为空")
    private String code;

    @ApiModelProperty(value = "岗位名称", required = true, example = "主管")
    @NotBlank(message = "岗位名称不能为空")
    private String name;

    @ApiModelProperty("备注")
    private String remark;


}
